package com.zues.enums;

/**
 * 枚举
 * @author 82165
 *
 */
public enum ShopStateEnum {
	CHECK(0, "审核中"), OFFLINE(-1, "非法店铺"), 
	SUCCESS(1, "操作成功"), PASS(2, "通过验证"), 
	INNER_ERROR(-1001, "内部系统错误"),NULL_SHOPID(-1002,"ShopId为空"),
	NULL_SHOP(-1003,"Shop信息为空"),NULL_SHOPCATE(-1004,"ShopCate信息为空"),NULL_SHOPAREA(-1005,"ShopArea信息为空");

	private int state;
	private String stateInfo;

	private ShopStateEnum(int state, String statseInfo) {
		this.state = state;
		this.stateInfo = statseInfo;
	}

	/**
	 * 依据传入的state返回相应的enum值
	 */
	public static ShopStateEnum stateOf(int state){
		for(ShopStateEnum stateEnum : values()){
			if(stateEnum.getState() == state){
				return stateEnum;
			}
		}
		return null;
	}

	public int getState() {
		return state;
	}

	public String getStateInfo() {
		return stateInfo;
	}
	
	
}
